home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_12_10
/
allison
/
arglist3.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1994-09-06
|
557b
|
28 lines
LISTING 18
#include <fstream.h>
#include "arglist3.h"
Arglist::Arglist(size_t arg_count, char **arg_vec)
: args(arg_count,0,CHUNK)
{
for (int i = 0; i < arg_count; ++i)
if (arg_vec[i][0] == '@')
expand(arg_vec[i]+1);
else
add(arg_vec[i]);
}
void Arglist::expand(char *fname)
{
ifstream f(fname);
const size_t BUFSIZ = 64;
char token[BUFSIZ];
while (f >> token)
if (token[0] == '@')
expand(token+1);
else
add(token);
}